<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Core Plot (iOS): CPTLegend Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="core-plot-logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Core Plot (iOS)
   
   </div>
   <div id="projectbrief">Cocoa plotting framework for Mac OS X and iOS</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript" src="dynsections.js"></script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Animation&#160;&&#160;Constants</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('interface_c_p_t_legend.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">CPTLegend Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="CPTLegend" --><!-- doxytag: inherits="CPTBorderedLayer" -->
<p>A graph legend.  
 <a href="interface_c_p_t_legend.html#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for CPTLegend:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="interface_c_p_t_legend__inherit__graph.png" border="0" usemap="#_c_p_t_legend_inherit__map" alt="Inheritance graph"/></div>
<map name="_c_p_t_legend_inherit__map" id="_c_p_t_legend_inherit__map">
<area shape="rect" id="node2" href="interface_c_p_t_bordered_layer.html" title="A layer with rounded corners." alt="" coords="172,406,311,437"/><area shape="rect" id="node4" href="interface_c_p_t_annotation_host_layer.html" title="A container layer for annotations." alt="" coords="150,326,332,357"/><area shape="rect" id="node6" href="interface_c_p_t_layer.html" title="Base class for all Core Animation layers in Core Plot." alt="" coords="201,246,281,277"/><area shape="rect" id="node8" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html" title="CALayer" alt="" coords="140,166,213,197"/><area shape="rect" id="node10" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html" title="NSObject" alt="" coords="5,86,85,117"/><area shape="rect" id="node12" href="http://developer.apple.com/iPhone/library/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html" title="\&lt;NSObject&#45;p\&gt;" alt="" coords="117,6,235,37"/><area shape="rect" id="node16" href="protocol_c_p_t_responder-p.html" title="The basis of all event processing in Core Plot." alt="" coords="238,166,375,197"/><area shape="rect" id="node14" href="http://www.devworld.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html" title="\&lt;CAMediaTiming&#45;p\&gt;" alt="" coords="109,86,269,117"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for CPTLegend:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="interface_c_p_t_legend__coll__graph.png" border="0" usemap="#_c_p_t_legend_coll__map" alt="Collaboration graph"/></div>
<map name="_c_p_t_legend_coll__map" id="_c_p_t_legend_coll__map">
<area shape="rect" id="node2" href="interface_c_p_t_bordered_layer.html" title="A layer with rounded corners." alt="" coords="172,406,311,437"/><area shape="rect" id="node4" href="interface_c_p_t_annotation_host_layer.html" title="A container layer for annotations." alt="" coords="150,326,332,357"/><area shape="rect" id="node6" href="interface_c_p_t_layer.html" title="Base class for all Core Animation layers in Core Plot." alt="" coords="201,246,281,277"/><area shape="rect" id="node8" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html" title="CALayer" alt="" coords="140,166,213,197"/><area shape="rect" id="node10" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html" title="NSObject" alt="" coords="5,86,85,117"/><area shape="rect" id="node12" href="http://developer.apple.com/iPhone/library/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html" title="\&lt;NSObject&#45;p\&gt;" alt="" coords="117,6,235,37"/><area shape="rect" id="node16" href="protocol_c_p_t_responder-p.html" title="The basis of all event processing in Core Plot." alt="" coords="238,166,375,197"/><area shape="rect" id="node14" href="http://www.devworld.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html" title="\&lt;CAMediaTiming&#45;p\&gt;" alt="" coords="109,86,269,117"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="class_c_p_t_legend-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Public Class Methods</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Factory Methods</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>)&#160;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_c_p_t_legend.html#a03b4f1ebac5433ca1e9f2417f9f8cb8e">legendWithPlots:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns a new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance with legend entries for each plot in the given array.  <a href="#a03b4f1ebac5433ca1e9f2417f9f8cb8e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>)&#160;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_c_p_t_legend.html#a2e62adb6a9f1a8db77e86908a4bc9041">legendWithGraph:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns a new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance with legend entries for each plot in the given graph.  <a href="#a2e62adb6a9f1a8db77e86908a4bc9041"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Instance Methods</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Initialization</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a70ce54e5ed07f13cfd66e4ed3d0f3149">initWithPlots:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a newly allocated <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object and adds legend entries for each plot in the given array.  <a href="#a70ce54e5ed07f13cfd66e4ed3d0f3149"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#aec7cd86be98703face8fdae14ea86321">initWithGraph:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a newly allocated <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object and adds legend entries for each plot in the given graph.  <a href="#aec7cd86be98703face8fdae14ea86321"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Plots</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#adf6acf1db67d39797186477afc5f8be2">allPlots</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">All plots associated with the legend.  <a href="#adf6acf1db67d39797186477afc5f8be2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a606ad66705362ba17e8376dd28197e41">plotAtIndex:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the plot at the given index in the plot array.  <a href="#a606ad66705362ba17e8376dd28197e41"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a393396b77a402fa40385672bcf9d1e64">plotWithIdentifier:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the plot with the given identifier from the plot array.  <a href="#a393396b77a402fa40385672bcf9d1e64"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a88cf4dd69f0608efd029742a505565a0">addPlot:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a plot to the legend.  <a href="#a88cf4dd69f0608efd029742a505565a0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#af1bc62e474d875286086fff2cc3da80e">insertPlot:atIndex:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a plot to the legend at the given index in the plot array.  <a href="#af1bc62e474d875286086fff2cc3da80e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a2e33766ad491f6c490ca74d864597d4d">removePlot:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a plot from the legend.  <a href="#a2e33766ad491f6c490ca74d864597d4d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a9f5efa6adcfa546733d35ea0f6603b46">removePlotWithIdentifier:</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a plot from the legend.  <a href="#a9f5efa6adcfa546733d35ea0f6603b46"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="properties"></a>
Properties</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Formatting</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b60c25e2d5d49d342f3a3e562e90454"></a><!-- doxytag: member="CPTLegend::textStyle" ref="a9b60c25e2d5d49d342f3a3e562e90454" args="" -->
<a class="el" href="interface_c_p_t_text_style.html">CPTTextStyle</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a9b60c25e2d5d49d342f3a3e562e90454">textStyle</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The text style used to draw all legend entry titles. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad0ce5727aa3224b63e1c7c37f48d27e"></a><!-- doxytag: member="CPTLegend::swatchSize" ref="aad0ce5727aa3224b63e1c7c37f48d27e" args="" -->
<a class="elRef" href="http://developer.apple.com/iPhone/library/documentation/GraphicsImaging/Reference/CGGeometry/Reference/reference.html#//apple_ref/doc/c_ref/CGSize.html">CGSize</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#aad0ce5727aa3224b63e1c7c37f48d27e">swatchSize</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the graphical swatch. If swatchSize is CGSizeZero, swatches will be drawn using a square 150% of the text size on a side. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7fc90787371445c50d495efe767bd77f"></a><!-- doxytag: member="CPTLegend::swatchBorderLineStyle" ref="a7fc90787371445c50d495efe767bd77f" args="" -->
<a class="el" href="interface_c_p_t_line_style.html">CPTLineStyle</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a7fc90787371445c50d495efe767bd77f">swatchBorderLineStyle</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The line style for the border drawn around each swatch. If nil (the default), no border is drawn. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac6ed09fb1c435f879d006cfb33536861"></a><!-- doxytag: member="CPTLegend::swatchCornerRadius" ref="gac6ed09fb1c435f879d006cfb33536861" args="" -->
CGFloat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legend_animation.html#gac6ed09fb1c435f879d006cfb33536861">swatchCornerRadius</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The corner radius for each swatch. Default is 0.0. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d18369e817fc379f39032269aba70c5"></a><!-- doxytag: member="CPTLegend::swatchFill" ref="a3d18369e817fc379f39032269aba70c5" args="" -->
<a class="el" href="interface_c_p_t_fill.html">CPTFill</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a3d18369e817fc379f39032269aba70c5">swatchFill</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The background fill drawn behind each swatch. If nil (the default), no fill is drawn. <br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Layout</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e4acf8dc17e77827dfad7836878229f"></a><!-- doxytag: member="CPTLegend::layoutChanged" ref="a9e4acf8dc17e77827dfad7836878229f" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">BOOL</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a9e4acf8dc17e77827dfad7836878229f">layoutChanged</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">If YES, the legend layout needs to recalculated. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af5ea166f66c3606dee40786fa0d7c9a3"></a><!-- doxytag: member="CPTLegend::numberOfRows" ref="af5ea166f66c3606dee40786fa0d7c9a3" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#af5ea166f66c3606dee40786fa0d7c9a3">numberOfRows</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The desired number of rows of legend entries. If zero (0) (the default), the number of rows will be automatically determined. If both numberOfRows and numberOfColumns are greater than zero but their product is less than the total number of legend entries, some entries will not be shown. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abcd7272e693f571b90f1e962a81b90e1"></a><!-- doxytag: member="CPTLegend::numberOfColumns" ref="abcd7272e693f571b90f1e962a81b90e1" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#abcd7272e693f571b90f1e962a81b90e1">numberOfColumns</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The desired number of columns of legend entries. If zero (0) (the default), the number of columns will be automatically determined. If both numberOfRows and numberOfColumns are greater than zero but their product is less than the total number of legend entries, some entries will not be shown. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a927726252bab5887a24447516e85ae56"></a><!-- doxytag: member="CPTLegend::equalRows" ref="a927726252bab5887a24447516e85ae56" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">BOOL</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a927726252bab5887a24447516e85ae56">equalRows</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">If YES (the default) each row of legend entries will have the same height, otherwise rows will be sized to best fit the entries. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a46f18330d8aac6eed93fedd124ad68e9"></a><!-- doxytag: member="CPTLegend::equalColumns" ref="a46f18330d8aac6eed93fedd124ad68e9" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">BOOL</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a46f18330d8aac6eed93fedd124ad68e9">equalColumns</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">If YES each column of legend entries will have the same width, otherwise columns will be sized to best fit the entries. Default is NO, meaning columns will be sized for the best fit. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03ab8a150c0127d18e458386e0f2cc0e"></a><!-- doxytag: member="CPTLegend::rowHeights" ref="a03ab8a150c0127d18e458386e0f2cc0e" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a03ab8a150c0127d18e458386e0f2cc0e">rowHeights</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The desired height of each row of legend entries, including the swatch and title. Each element in this array should be an <a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/Reference/Reference.html">NSNumber</a> representing the height of the corresponding row in device units. Rows are numbered from top to bottom starting from zero (0). If nil, all rows will be sized automatically. If there are more rows in the legend than specified in this array, the remaining rows will be sized automatically. Default is nil. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48ca97b8055fba0008dd2653ca5f8da2"></a><!-- doxytag: member="CPTLegend::rowHeightsThatFit" ref="a48ca97b8055fba0008dd2653ca5f8da2" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a48ca97b8055fba0008dd2653ca5f8da2">rowHeightsThatFit</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The computed best-fit height of each row of legend entries, including the swatch and title. Each element in this array is an <a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/Reference/Reference.html">NSNumber</a> representing the height of the corresponding row in device units. Rows are numbered from top to bottom starting from zero (0). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa3e60ac4f993f563f296f960e312fb3d"></a><!-- doxytag: member="CPTLegend::columnWidths" ref="aa3e60ac4f993f563f296f960e312fb3d" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#aa3e60ac4f993f563f296f960e312fb3d">columnWidths</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The desired width of each column of legend entries, including the swatch, title, and title offset. Each element in this array should be an <a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/Reference/Reference.html">NSNumber</a> representing the width of the corresponding column in device units. Columns are numbered from left to right starting from zero (0). If nil, all columns will be sized automatically. If there are more columns in the legend than specified in this array, the remaining columns will be sized automatically. Default is nil. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48e2326472517ac2a8a95275e06e038c"></a><!-- doxytag: member="CPTLegend::columnWidthsThatFit" ref="a48e2326472517ac2a8a95275e06e038c" args="" -->
<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a48e2326472517ac2a8a95275e06e038c">columnWidthsThatFit</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The computed best-fit width of each column of legend entries, including the swatch, title, and title offset. Each element in this array is an <a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/Reference/Reference.html">NSNumber</a> representing the width of the corresponding column in device units. Columns are numbered from left to right starting from zero (0). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb399203b06781b785122a4f80029a0e"></a><!-- doxytag: member="CPTLegend::columnMargin" ref="abb399203b06781b785122a4f80029a0e" args="" -->
CGFloat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#abb399203b06781b785122a4f80029a0e">columnMargin</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The margin between columns, specified in device units. Default is 10.0. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a439fd2339a91f649cbaf8cef9c780512"></a><!-- doxytag: member="CPTLegend::rowMargin" ref="a439fd2339a91f649cbaf8cef9c780512" args="" -->
CGFloat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#a439fd2339a91f649cbaf8cef9c780512">rowMargin</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The margin between rows, specified in device units. Default is 5.0. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc4ef7ce3c95c69d3d03be080f274c9b"></a><!-- doxytag: member="CPTLegend::titleOffset" ref="adc4ef7ce3c95c69d3d03be080f274c9b" args="" -->
CGFloat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_p_t_legend.html#adc4ef7ce3c95c69d3d03be080f274c9b">titleOffset</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The distance between each swatch and its title, specified in device units. Default is 5.0. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a24d66983bfa3714a97c53268f8fde7d2"></a><!-- doxytag: member="CPTLegend::setLayoutChanged" ref="a24d66983bfa3714a97c53268f8fde7d2" args="()" -->
(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_p_t_legend.html#a24d66983bfa3714a97c53268f8fde7d2">setLayoutChanged</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks the receiver as needing to update the layout of its legend entries. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A graph legend. </p>
<p>The legend consists of one or more legend entries associated with plots. Each legend entry is made up of a graphical "swatch" that corresponds with the plot and a text title or label to identify the data series to the viewer. The swatches provide a visual connection to the plot. For instance, a swatch for a scatter plot might include a line segment drawn in the line style of the plot along with a plot symbol while a swatch for a pie chart might only show a rectangle or other shape filled with the background fill of the corresponding pie slice.</p>
<p>The plots are not required to belong to the same graph, although that is the usual case. This allows creation of a master legend that covers multiple graphs.</p>
<dl class="see"><dt><b>See also:</b></dt><dd>See <a class="el" href="group__legend_animation.html">Legends</a> for a list of animatable properties. </dd></dl>
</div><hr/><h2>Method Documentation</h2>
<a class="anchor" id="a88cf4dd69f0608efd029742a505565a0"></a><!-- doxytag: member="CPTLegend::addPlot:" ref="a88cf4dd69f0608efd029742a505565a0" args="(CPTPlot *plot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) <a class="el" href="interface_c_p_t_legend.html#a88cf4dd69f0608efd029742a505565a0">addPlot:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *)&#160;</td>
          <td class="paramname"><em>plot</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Add a plot to the legend. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">plot</td><td>The plot. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adf6acf1db67d39797186477afc5f8be2"></a><!-- doxytag: member="CPTLegend::allPlots" ref="adf6acf1db67d39797186477afc5f8be2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *) <a class="el" href="interface_c_p_t_legend.html#adf6acf1db67d39797186477afc5f8be2">allPlots</a> </td>
          <td></td>
          <td class="paramname"></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>All plots associated with the legend. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An array of all plots associated with the legend. </dd></dl>

</div>
</div>
<a class="anchor" id="aec7cd86be98703face8fdae14ea86321"></a><!-- doxytag: member="CPTLegend::initWithGraph:" ref="aec7cd86be98703face8fdae14ea86321" args="(CPTGraph *graph)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>) <a class="el" href="interface_c_p_t_legend.html#aec7cd86be98703face8fdae14ea86321">initWithGraph:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_c_p_t_graph.html">CPTGraph</a> *)&#160;</td>
          <td class="paramname"><em>graph</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes a newly allocated <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object and adds legend entries for each plot in the given graph. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">graph</td><td>A graph. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The initialized <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object. </dd></dl>

</div>
</div>
<a class="anchor" id="a70ce54e5ed07f13cfd66e4ed3d0f3149"></a><!-- doxytag: member="CPTLegend::initWithPlots:" ref="a70ce54e5ed07f13cfd66e4ed3d0f3149" args="(NSArray *newPlots)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>) <a class="el" href="interface_c_p_t_legend.html#a70ce54e5ed07f13cfd66e4ed3d0f3149">initWithPlots:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *)&#160;</td>
          <td class="paramname"><em>newPlots</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes a newly allocated <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object and adds legend entries for each plot in the given array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">newPlots</td><td>An array of plots. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The initialized <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> object. </dd></dl>

</div>
</div>
<a class="anchor" id="af1bc62e474d875286086fff2cc3da80e"></a><!-- doxytag: member="CPTLegend::insertPlot:atIndex:" ref="af1bc62e474d875286086fff2cc3da80e" args="(CPTPlot *plot,[atIndex] NSUInteger index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) insertPlot: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *)&#160;</td>
          <td class="paramname"><em>plot</em></td>
        </tr>
        <tr>
          <td class="paramkey">atIndex:</td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>)&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Add a plot to the legend at the given index in the plot array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">plot</td><td>The plot. </td></tr>
    <tr><td class="paramname">index</td><td>An index within the bounds of the plot array. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2e62adb6a9f1a8db77e86908a4bc9041"></a><!-- doxytag: member="CPTLegend::legendWithGraph:" ref="a2e62adb6a9f1a8db77e86908a4bc9041" args="(CPTGraph *graph)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">+ (<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>) <a class="el" href="interface_c_p_t_legend.html#a2e62adb6a9f1a8db77e86908a4bc9041">legendWithGraph:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_c_p_t_graph.html">CPTGraph</a> *)&#160;</td>
          <td class="paramname"><em>graph</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns a new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance with legend entries for each plot in the given graph. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">graph</td><td>The graph. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance. </dd></dl>

</div>
</div>
<a class="anchor" id="a03b4f1ebac5433ca1e9f2417f9f8cb8e"></a><!-- doxytag: member="CPTLegend::legendWithPlots:" ref="a03b4f1ebac5433ca1e9f2417f9f8cb8e" args="(NSArray *newPlots)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">+ (<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>) <a class="el" href="interface_c_p_t_legend.html#a03b4f1ebac5433ca1e9f2417f9f8cb8e">legendWithPlots:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html">NSArray</a> *)&#160;</td>
          <td class="paramname"><em>newPlots</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns a new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance with legend entries for each plot in the given array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">newPlots</td><td>An array of plots. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A new <a class="el" href="interface_c_p_t_legend.html" title="A graph legend.">CPTLegend</a> instance. </dd></dl>

</div>
</div>
<a class="anchor" id="a606ad66705362ba17e8376dd28197e41"></a><!-- doxytag: member="CPTLegend::plotAtIndex:" ref="a606ad66705362ba17e8376dd28197e41" args="(NSUInteger index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *) <a class="el" href="interface_c_p_t_legend.html#a606ad66705362ba17e8376dd28197e41">plotAtIndex:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>)&#160;</td>
          <td class="paramname"><em>index</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the plot at the given index in the plot array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">index</td><td>An index within the bounds of the plot array. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The plot at the given index. </dd></dl>

</div>
</div>
<a class="anchor" id="a393396b77a402fa40385672bcf9d1e64"></a><!-- doxytag: member="CPTLegend::plotWithIdentifier:" ref="a393396b77a402fa40385672bcf9d1e64" args="(id&lt; NSCopying &gt; identifier)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *) <a class="el" href="interface_c_p_t_legend.html#a393396b77a402fa40385672bcf9d1e64">plotWithIdentifier:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>&lt;NSCopying&gt;)&#160;</td>
          <td class="paramname"><em>identifier</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the plot with the given identifier from the plot array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">identifier</td><td>A plot identifier. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The plot with the given identifier or nil if it was not found. </dd></dl>

</div>
</div>
<a class="anchor" id="a2e33766ad491f6c490ca74d864597d4d"></a><!-- doxytag: member="CPTLegend::removePlot:" ref="a2e33766ad491f6c490ca74d864597d4d" args="(CPTPlot *plot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) <a class="el" href="interface_c_p_t_legend.html#a2e33766ad491f6c490ca74d864597d4d">removePlot:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_c_p_t_plot.html">CPTPlot</a> *)&#160;</td>
          <td class="paramname"><em>plot</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove a plot from the legend. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">plot</td><td>The plot to remove. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9f5efa6adcfa546733d35ea0f6603b46"></a><!-- doxytag: member="CPTLegend::removePlotWithIdentifier:" ref="a9f5efa6adcfa546733d35ea0f6603b46" args="(id&lt; NSCopying &gt; identifier)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) <a class="el" href="interface_c_p_t_legend.html#a9f5efa6adcfa546733d35ea0f6603b46">removePlotWithIdentifier:</a> </td>
          <td></td>
          <td class="paramtype">(<a class="elRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">id</a>&lt;NSCopying&gt;)&#160;</td>
          <td class="paramname"><em>identifier</em></td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove a plot from the legend. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">identifier</td><td>The identifier of the plot to remove. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Source/<a class="el" href="_c_p_t_legend_8h_source.html">CPTLegend.h</a></li>
<li>Source/CPTLegend.m</li>
</ul>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="interface_c_p_t_legend.html">CPTLegend</a>      </li>

    <li class="footer">Generated by <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a></li>
   </ul>
 </div>


</body>
</html>
